.calendar { flex: 1 1 auto; min-width: 0; }
.row { display: flex; gap: var(--col-gap); }
.day { flex: 1 1 0; min-width: 0; }
.day-name { font-size: 12px; font-weight: 500; text-align: center; color: var(--text-muted); margin-bottom: 6px; }

.day-scroll {
  height: calc((var(--row-h) + var(--row-gap)) * 10);
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
}
.agenda .day-scroll { height: auto; overflow: visible; }

.band-label {
  font-size: 10px; letter-spacing: .04em; color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding: 5px 0 4px; margin-top: 2px;
}
.band-label.first { border-top: none; margin-top: 0; padding-top: 0; }
.band-scroll {
  height: calc((var(--row-h) + var(--row-gap)) * 5);
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
}
.agenda .band-scroll { height: auto; overflow: visible; }

.slot {
  height: var(--row-h); display: flex; align-items: center; gap: 4px;
  padding: 0 5px; margin-bottom: var(--row-gap); font-size: 11px;
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden;
  transition: background .12s, border-color .12s, opacity .12s;
}
.slot.filled { border-left-width: 4px; cursor: pointer; color: var(--text); }
.slot .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.slot.next { border-style: dashed; border-color: var(--accent-border); }
.slot.drop-target { border-color: #185fa5; border-style: solid; background: #eef5fc; }
.slot.dimmed { opacity: .2; }
.slot-note { font-size: 10px; color: var(--text-muted); flex: 0 0 auto; }
.task.dragging, .slot.dragging { opacity: .4; }

.check {
  flex: 0 0 auto; width: 14px; height: 14px; padding: 0; cursor: pointer;
  border: 1px solid var(--text-muted); border-radius: 50%;
  background: transparent; color: var(--text);
  font-size: 9px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.check:hover { border-color: var(--text); background: var(--surface-alt); }
.check.done { border-color: var(--text); }

.done-row {
  width: 100%; margin-top: 4px; font: inherit; font-size: 10px;
  padding: 4px 5px; cursor: pointer; text-align: left;
  color: var(--text-muted); background: transparent;
  border: 1px solid transparent; border-top: 1px solid var(--border);
  border-radius: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.done-row:hover { color: var(--text); background: var(--surface-alt); }
.done-row.empty { opacity: .45; }

.agenda { display: none; max-height: 520px; overflow-y: auto; padding-right: 4px; }
.agenda .day { margin-bottom: 14px; }
.agenda .day-name { text-align: left; }
.day.overflow-day { display: block; }
@media (max-width: 960px) { .day.overflow-day { display: none; } }
@media (max-width: 660px) {
  #week { display: none; }
  .agenda { display: block; }
}

.cal-nav {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.cal-nav .icon-btn:disabled { opacity: .3; cursor: default; }
.nav-today { font-size: 11px; padding: 4px 10px; }
.nav-today.on { border-color: var(--text); color: var(--text); }
.cal-range { flex: 1; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.day.is-today .day-name { color: var(--text); font-weight: 600; }
.day.is-today .day-name::after {
  content: ""; display: block; height: 2px; margin-top: 3px;
  background: var(--text); border-radius: 1px;
}

.month-pop { width: 212px; padding: 10px; }
.month-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; margin-bottom: 8px; }
.micon {
  width: 20px; height: 20px; padding: 0; cursor: pointer;
  border: 1px solid var(--border); border-radius: 4px;
  background: transparent; color: var(--text-muted); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.micon:hover { background: var(--surface-alt); }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mhead { font-size: 9px; color: var(--text-muted); text-align: center; padding-bottom: 3px; }
.mcell {
  position: relative; height: 24px; cursor: pointer; padding: 0;
  font: inherit; font-size: 11px; color: var(--text);
  background: transparent; border: 1px solid transparent; border-radius: 4px;
}
.mcell:hover { background: var(--surface-alt); }
.mcell.outside { color: var(--text-muted); opacity: .45; }
.mcell.inweek { background: var(--surface-alt); border-color: var(--border); }
.mcell.mtoday { font-weight: 700; border-color: var(--text); }
.mdot {
  position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted);
}

.slot-repeat {
  visibility: hidden; flex: 0 0 auto;
  appearance: none; border: none; background: none; cursor: pointer;
  color: var(--text-muted); padding: 0 1px; line-height: 1;
}
.slot-repeat i { font-size: 11px; }
.slot.filled:hover .slot-repeat { visibility: visible; }
.slot-repeat:hover { color: var(--text); }
