/* ===== DAY MAP (floating bottom-right pill) ===== */
.day-map {
  position: fixed;
  bottom: 150px;
  right: 0;
  z-index: 95;
  background: rgba(250,246,241,0.08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(61,50,41,0.08);
  border-right: none;
  border-radius: 18px 0 0 18px;
  padding: 0.5rem 0.25rem 0.5rem 0.4rem;
  box-shadow: 0 4px 20px rgba(61,50,41,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 38px;
  transition: padding 0.25s ease;
}

.day-map.collapsed {
  padding: 0.4rem 0.35rem;
}

.day-map.collapsed .day-map-track,
.day-map.collapsed .day-map-streak {
  display: none;
}

.day-map-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.15rem;
  font-size: 0.6rem;
  color: var(--bark-light);
  transition: transform 0.25s;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}

.day-map.collapsed .day-map-toggle {
  transform: rotate(180deg);
}

.dm-actions {
  position: fixed;
  z-index: 94;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.dm-action-btn {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--mist);
  background: var(--warm-white);
  border-radius: 50%;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(61,50,41,0.06);
}

.dm-action-btn:hover {
  background: var(--sage-muted);
  border-color: var(--sage-light);
  transform: scale(1.08);
}

.day-map-header { display: none; }

.day-map-progress {
  font-size: 0.5rem;
  font-weight: 600;
  color: var(--bark-light);
  margin-bottom: 0.35rem;
  text-align: center;
  line-height: 1.15;
}

.day-map-progress strong {
  display: block;
  font-size: 0.88rem;
  color: var(--bark);
  font-weight: 700;
}

.day-map-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
  cursor: pointer;
  touch-action: none;
}

.dm-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 0.1rem 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}

.dm-node:active { transform: scale(0.88); }

/* Letter inside dot */
.dm-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--mist);
  background: rgba(254,252,249,0.45);
  font-size: 0.55rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--bark-light);
}

.dm-node.past .dm-dot {
  border-style: dashed;
  border-color: var(--bark-light);
  color: var(--bark-light);
  opacity: 0.6;
}

.dm-node.done .dm-dot {
  border-color: var(--sage);
  border-style: solid;
  background: var(--sage);
  color: white;
}

.dm-node.now .dm-dot {
  border-color: var(--terracotta);
  background: var(--terracotta);
  color: white;
  width: 22px;
  height: 22px;
  font-size: 0.6rem;
  box-shadow: 0 0 0 3px rgba(196,112,75,0.2);
  animation: pulse-now 2s ease-in-out infinite;
}

@keyframes pulse-now {
  0%, 100% { box-shadow: 0 0 0 3px rgba(196,112,75,0.2); }
  50% { box-shadow: 0 0 0 6px rgba(196,112,75,0.08); }
}

.dm-time {
  font-size: 0.52rem;
  font-weight: 700;
  color: var(--bark-light);
  margin-top: 0.1rem;
  line-height: 1;
}

.dm-node.now .dm-time { color: var(--terracotta); }
.dm-node.done .dm-time { color: var(--sage); }
.dm-node.past .dm-time { opacity: 0.5; }

.dm-now-label {
  font-size: 0.4rem;
  font-weight: 800;
  color: var(--terracotta);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 0.05rem;
}

.dm-line {
  width: 2px;
  height: 4px;
  background: var(--mist);
  flex-shrink: 0;
}

.dm-line.done { background: var(--sage); }
.dm-line.active { background: linear-gradient(to bottom, var(--sage), var(--terracotta)); }

/* Minimap viewport indicator */
.dm-viewport {
  position: absolute;
  left: -5px;
  right: -5px;
  border: 2px solid var(--terracotta);
  border-radius: 8px;
  background: rgba(196,112,75,0.07);
  pointer-events: auto;
  cursor: grab;
  transition: top 0.12s ease-out, height 0.12s ease-out;
  touch-action: none;
  z-index: 4;
}

.day-top-bar { display: none; }

@media (min-width: 900px) {
  .meal-plan {
    max-width: 620px;
    margin: 0 auto;
    padding: 0.5rem 1rem 1rem;
  }
  .shopping-section {
    max-width: 620px;
    margin: 0 auto;
  }
  .meal-block {
    border-radius: 16px;
  }
  .option-swap {
    border-radius: 0;
  }
  .routine-card {
    border-radius: 10px;
  }
  .day-map {
    position: fixed;
    bottom: auto;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    right: 0;
    box-shadow: none;
    background: var(--warm-white);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(61,50,41,0.06);
    border-right: none;
    border-radius: 16px 0 0 16px;
    padding: 0.75rem 0.6rem 0.75rem 0.5rem;
  }
  .dm-actions {
    right: 6px;
    left: auto !important;
  }
}
